package com.ifly.task.pojo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;

/**
 * @program: excel
 * @description: todo
 * @author: xuYao2
 * @create: 2022-07-21 23:28
 **/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table(name = "country")
@EntityListeners(AuditingEntityListener.class)
public class Country {

    @Id
    @Column(nullable = false, columnDefinition = "bigint comment '主键id'")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "country_name", columnDefinition = "varchar(128) COMMENT '国家名称'")
    private String countryName;

    @Column(name = "power", columnDefinition = "varchar(128) COMMENT '掌权者名字'")
    private String power;

    @Column(name = "prime_minister", columnDefinition = "varchar(128) COMMENT '丞相名字'")
    private String primeMinister;

    /**
     * 自动创建时间：https://blog.csdn.net/jj89929665/article/details/119487947
     */
    @Column(name = "create_time", columnDefinition = "datetime COMMENT '国家建立时间'")
    @CreatedDate
    private Date createTime;
}
